package tech.aistar.service.collecte.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.Collectes;
import tech.aistar.mapper.collecte.CollecteViewMapper;
import tech.aistar.service.collecte.ICollectesViewService;

import java.util.List;

/**
 * Created by Administrator on 2019/9/28 0028.
 */
@Service
@Transactional
public class CollecteViewImpl implements ICollectesViewService {
    @Autowired
    private CollecteViewMapper collecteViewMapper;
    @Override
    public List<Collectes> colviewFindAll(Integer id) {
        List<Collectes> collectesViewList = collecteViewMapper.colviewFindAll(id);
        return collectesViewList;
    }

    @Override
    public List<Collectes> colViewFindOne(Integer userinfoId) {
        List<Collectes> collectesViewList2 = collecteViewMapper.colViewFindOne(userinfoId);
        return collectesViewList2;
    }

    @Override
    public List<Collectes> colFindAll() {
        List<Collectes> collectesList = collecteViewMapper.colFindAll();
        return  collectesList;
    }

    @Override
    public List<Collectes> serviceFind(Integer servicesId) {
        List<Collectes> collectesList = collecteViewMapper.serviceFind(servicesId);
        return collectesList;
    }

    @Override
    public PageInfo<Collectes> findAll(Integer userinfoId, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);

        List<Collectes> pageviewList = collecteViewMapper.colViewFindOne(userinfoId);

        PageInfo<Collectes> pageInfo = new PageInfo<>(pageviewList);
        return pageInfo;
    }
}
